package cn.kgc.service.impl;

import cn.kgc.mapper.ClientMapper;
import cn.kgc.pojo.Client;
import cn.kgc.service.ClientService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ClientServiceImpl implements ClientService {
    @Autowired
    private ClientMapper clientMapper;


    @Override
    public int ClientUpdate(Client client) {
        return clientMapper.ClientUpdate(client);
    }

    @Override
    public Client getById(Integer clientId) {
        return clientMapper.getById(clientId);
    }

    @Override
    public Client getByName(String clientName) {
        return clientMapper.getByName(clientName);
    }

    @Override
    public int ClientDelete(Integer clientId) {
        return clientMapper.ClientDelete(clientId);
    }

    @Override
    public int ClientAdd(Client client) {
        return clientMapper.ClientAdd(client);
    }

    @Override
    public int ClientAdd1(String phone, String idCard, String clientName) {
        return clientMapper.ClientAdd1(phone,idCard,clientName);
    }


    @Override
    public int getToalCount(String clientName) {
        return clientMapper.getToalCount(clientName);
    }

    @Override
    public List<Client> getClientList(Integer currenPage, String clientName, Integer limit) {
        System.out.println(clientName);
        return clientMapper.getClientList(currenPage,clientName, limit);
    }
}